package com.cskaoyan.mapper;

import com.cskaoyan.bean.Category;
import com.cskaoyan.bean.Goods;
import com.cskaoyan.bean.bo.GoodListBO;
import com.cskaoyan.bean.bo.GoodsAttributeBO;
import com.cskaoyan.bean.bo.GoodsProductBO;
import com.cskaoyan.bean.bo.GoodsSpecificationBO;
import com.cskaoyan.bean.po.*;
import com.cskaoyan.bean.vo.GoodsCatAndBrandBrandVO;
import com.cskaoyan.bean.vo.GoodsCatAndBrandCategoryChildrenVO;
import com.cskaoyan.bean.vo.GoodsCatAndBrandCategoryVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface GoodsMapper {
    List<GoodsPO> selectGoods(@Param("sort") String sort,@Param("order") String order,@Param("goodsId") Integer goodsId,@Param("goodsSn") String goodsSn, @Param("name") String name);




    int insertGoods(GoodsListPO goodListBO);


    void insertAttributes(@Param("attributes") List<GoodsAttributeBO> attributes);

    void insertProduct(GoodsProductsPO goodsProductsPO);

    void insertSpecification(@Param("specificationBOS") List<GoodsSpecificationBO> specificationBOS);


    int updateGoods(GoodsListPO goodListBO);

    int updateAttribute(GoodsAttributePO po);

    int updateProduct(GoodsProductsPO po);

    int updateSpecification(GoodsSpecificationPO po);

    int deleteGoods(GoodsListPO goodListBO);

    Goods selectByPrimaryKey(Integer id);

    List<GoodsSpecificationBO> selectByGoodsId1(@Param("goodsSn") String goodsSn);

    List<GoodsAttributeBO> selectByGoodsId2(String goodsSn);

    List<GoodsProductPO> selectByGoodsId3(String goodsSn);

    Category selectByCategory(Integer id);

    List<GoodsCatAndBrandCategoryVO> getBrand();

    List<GoodsCatAndBrandBrandVO> getCategory(Integer notHaveParentCategory);

    List<GoodsCatAndBrandCategoryChildrenVO> getChilderCategory(Integer parentCategoryId);
}
